package com.my.test.java.autocode.entiy;

import com.my.test.java.autocode.util.ACStringUtils;

public class Proporty {

	private String decorate;
	private String name;
	private String type;
	private boolean isInit;
	private Object initVal;
	public Proporty(){}
	
	public Proporty(String decorate,String name,String type){
		this.decorate = decorate;
		this.name = name;
		this.type = type;
	}
	public Proporty(String decorate,String name,String type,boolean isInit,Object initVal){
		this.decorate = decorate;
		this.name = name;
		this.type = type;
		this.isInit = isInit;
		this.initVal = initVal;
	}
	public String initPro(){
		StringBuilder bs = new StringBuilder();
		bs.append(ACStringUtils.StringType.tab).append(decorate+" ").append(type+" ").append(name);
		if(isInit){
			bs.append(" = ").append(initVal);
		}else{
			bs.append(";").append(ACStringUtils.StringType.newline);
		}
		return bs.toString();
	}
	public String getDecorate() {
		return decorate;
	}
	public void setDecorate(String decorate) {
		this.decorate = decorate;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public boolean isInit() {
		return isInit;
	}
	public void setInit(boolean isInit) {
		this.isInit = isInit;
	}
	public Object getInitVal() {
		return initVal;
	}
	public void setInitVal(Object initVal) {
		this.initVal = initVal;
	}
}
